package org.erp.product.infrastructure.convert;

import org.erp.product.domain.bo.RepairActionBo;
import org.erp.product.domain.bo.RepairInfoQueryBo;
import org.erp.product.domain.dto.RepairActionDto;
import org.erp.product.domain.dto.RepairInfoQueryDto;
import org.erp.product.domain.entity.ConnectLog;
import org.erp.product.domain.entity.RepairInfo;
import org.erp.product.domain.vo.RepairInfoVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface RepairInfoConvert {

    @Mappings(value = {
            @Mapping(target = "id", ignore = true),
            @Mapping(target = "operationId", source = "transferId"),
            @Mapping(target = "operationName", source = "transferName"),
            @Mapping(target = "repairStatus", constant = "0"),
            @Mapping(target = "createTime", ignore = true),
            @Mapping(target = "createBy", ignore = true),
            @Mapping(target = "updateTime", ignore = true),
            @Mapping(target = "updateBy", ignore = true)
    })
    RepairInfo convert(ConnectLog connectLog);

    @Mappings(value = {})
    RepairInfoQueryDto boConvertDto(RepairInfoQueryBo repairInfoQueryBo);

    @Mappings(value = {})
    RepairInfoVo convertVo(RepairInfo repairInfo);

    @Mappings(value = {})
    RepairActionDto boConvertDto(RepairActionBo repairActionBo);
}
